
// components/list/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    book: Object
  },

  /**
   * 组件的初始数据
   */
  data: {
    
  },

  /**
   * 组件的方法列表
   */
  methods: {
    onTap(event) {
      const bid = this.properties.book.id
      wx.navigateTo({
        url: `/pages/detail/index?bid=${bid}`
      })
    },
    addToCart(event) {
      const bid = this.properties.book.id
      this.triggerEvent('getcart', event.detail.bid, {})
    }
  }
  
})
